import request from '@/utils/request'

export function listFolder(data) {
  return request({
    url: '/api/fd/folder/list',
    method: 'post',
    data
  })
}

export function listTreeFolder(data) {
  return request({
    url: '/api/fd/folder/list_tree',
    method: 'post',
    data
  })
}

export function listTreeFolderOnlyFolder(data) {
  return request({
    url: '/api/fd/folder/list_tree_folder',
    method: 'post',
    data
  })
}

// 移动文件夹
export function updateMoveFolder(data) {
  return request({
    url: '/api/fd/folder/update_move',
    method: 'post',
    data
  })
}

export function saveFolder(data) {
  return request({
    url: '/api/fd/folder/save',
    method: 'post',
    data
  })
}

export function deleteFolder(data) {
  return request({
    url: '/api/fd/folder/delete',
    method: 'post',
    data
  })
}

export function recoverFolder(data) {
  return request({
    url: '/api/fd/folder/recover',
    method: 'post',
    data
  })
}

export function updateNameFolder(data) {
  return request({
    url: '/api/fd/folder/update_name',
    method: 'post',
    data
  })
}


/**
 * 获取文档详情
 * @param data
 * @returns {AxiosPromise}
 */
export function getDocumentParticulars(data) {
  return request({
    url: '/api/fd/document/get',
    method: 'post',
    data
  })
}


/**
 * 获取文档属性信息获取文件夹信息
 * @param data
 * @returns {AxiosPromise}
 */
export function getFolderInfo(data) {
  return request({
    url: '/api/fd/folder/getFolderInfo',
    method: 'post',
    data
  })
}


/**
 * 文件夹复制/
 * @param data
 * @returns {AxiosPromise}
 */
export function copyFolder(data) {
  return request({
    url: '/api/fd/folder/copy_folder',
    method: 'post',
    data
  })
}


/**
 * 获取台账文件
 * @param data
 * @returns {AxiosPromise}
 */
export function getLedger(data) {
  return request({
    url: '/api/fd/repository/get_ledger',
    method: 'post',
    data
  })
}